package com.example.vote.controller;

import com.example.vote.model.Vote;
import com.example.vote.service.VoteService;
import com.example.vote.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * ClassName: VoteController
 * Package: com.example.vote.controller
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-06-26
 * Time: 10:29
 */

@RestController
@RequestMapping("/vote")
public class VoteController {

    @Autowired
    private VoteService voteService;

    @GetMapping("/find")
    public Result<List<Vote>> find(){
        List<Vote> list = voteService.list();

        return new Result<>(1,"查询成功",list);

    }
}
